package com.cn.auth.serviceImpl.blog;

import com.cn.auth.dao.blog.BlogDao;
import com.cn.auth.po.blog.Blog;
import com.cn.auth.po.blog.Comment;
import com.cn.auth.po.blog.Notice;
import com.cn.auth.service.blog.BlogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service
public class BlogServiceImpl implements BlogService {
	@Resource
	BlogDao blogDao;

	@Override
	public Integer insertBlog(Blog blog) {
		return blogDao.insertBlog(blog);
	}

	@Override
	public List<Blog> getBlogList(Blog blog) {
		return blogDao.getBlogList(blog);
	}

	@Override
	public Integer getBlogListCount(Blog blog) {
		return blogDao.getBlogListCount(blog);
	}

	@Override
	public Integer updateBlog(Blog blog) {
		return blogDao.updateBlog(blog);
	}

	@Override
	public Integer addBlogReadCount(Integer id) {
		return blogDao.addBlogReadCount(id);
	}

	@Override
	public Integer addBlogPointsCount(Integer id) {
		return blogDao.addBlogPointsCount(id);
	}
	@Override
	public Integer delteBlogById(String[] ids){
		return blogDao.delteBlogById(ids);
	}
	@Override
	public Blog getBlogById(Integer id){
		return blogDao.getBlogById(id);
	}

	@Override
	public Integer insertComment(Comment comment) {
		return blogDao.insertComment(comment);
	}

	@Override
	public List<Comment> getCommetByBlogId(Integer blogId) {
		return blogDao.getCommetByBlogId(blogId);
	}

	@Override
	public List<Map<String, Object>> getCommetList(Comment comment) {
		return blogDao.getCommetList(comment);
	}

	@Override
	public Integer getCommetListCount(Comment comment) {
		return blogDao.getCommetListCount(comment);
	}

	@Override
	public Integer insertNotice(Notice notice) {
		return blogDao.insertNotice(notice);
	}

	@Override
	public List<Notice> getNoticeList(Notice notice) {
		return blogDao.getNoticeList(notice);
	}

	@Override
	public Integer getNoticeListCount(Notice notice) {
		return  blogDao.getNoticeListCount(notice);
	}

	@Override
	public Integer deleteCommentByIds(String[] ids) {
		return blogDao.deleteCommentByIds(ids);
	}

	@Override
	public Integer deleteNoticeByIds(String[] ids) {
		return blogDao.deleteNoticeByIds(ids);
	}

	public  Integer updateNoticeById(Notice notice){
		return blogDao.updateNoticeById(notice);
	}

	public  Notice getNoticeById(Integer id){
		return blogDao.getNoticeById(id);
	}
	public  Notice getNoticeTop1ByType(Integer type){
		return blogDao.getNoticeTop1ByType(type);
	}
}
